package com.wn.ticket.web;

import com.wn.ticket.common.ResponseEntity;
import com.wn.ticket.entity.Artist;
import com.wn.ticket.service.ArtistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/front/artist")
public class ArtistController {
    @Autowired
    private ArtistService artistService;
    @RequestMapping("/hot")
    public ResponseEntity getByFans() {
        List<Artist> list = artistService.getByFans();

        return new ResponseEntity(list);
    }
    @RequestMapping("/getById/{id}")
    public ResponseEntity getById(@PathVariable int id) {
        Artist artist = artistService.getById(id);

        return new ResponseEntity(artist);
    }

}
